/**
 * Created by PVer on 2019-08-29.
 */
import axios from '@/libs/api.request'
/**
 * 获取上传的token数据
 * @returns {wx.RequestTask | never}
 */
export const getFolders = () => {
  return axios.request({
    url: 'Imgs/getFolders',
    method: 'get'
  })
};
export const getImgs = (params) => {
  return axios.request({
    url: 'Imgs/getImgs',
    method: 'get',
    params:params
  })
};
export const delImg = (id) => {
  return axios.request({
    url: 'Imgs/delImg',
    method: 'get',
    params:{id:id}
  })
};
export const delFolder = (id) => {
  return axios.request({
    url: 'Imgs/delFolder',
    method: 'get',
    params:{id:id}
  })
};
export const addFolder = (name) => {
  return axios.request({
    url: 'Imgs/addFolder',
    method: 'get',
    params:{name:name}
  })
};
export const renameFolder = (id,name) => {
  return axios.request({
    url: 'Imgs/renameFolder',
    method: 'get',
    params:{id:id,name:name}
  })
};
/**
 * 移动到另一个目录
 * @param ids 移动的文件id集合
 * @param fid 目标目录的id
 */
export const move = (ids,fid) => {
  return axios.request({
    url: 'Imgs/move',
    method: 'get',
    params:{ids:JSON.stringify(ids),fid:fid}
  })
};
/**
 * 批量删除图片
 * @param ids 删除的文件id集合
 */
export const delImgs = (ids) => {
  return axios.request({
    url: 'Imgs/delImgs',
    method: 'get',
    params:{ids:JSON.stringify(ids)}
  })
};
